package com.xinchao.service;

import com.xinchao.exception.ServiceException;
import com.xinchao.model.Advertiser;
import com.xinchao.model.User;
import com.xinchao.model.dto.AdvertiserListDTO;
import com.xinchao.model.dto.AdvertiserSelectDTO;
import com.xinchao.model.page.PageInfo;

import java.util.List;

/**
 * @author dxy
 * @date 2018/9/18 18:28
 */
public interface AdvertiserService {
	/**
	 * 保存广告主
	 *
	 * @param advertiser Advertiser
	 * @param loginUser     User
	 * @param remoteIP      远程ip
	 * @throws ServiceException
	 */
	void saveAdvertiser(Advertiser advertiser, User loginUser, String remoteIP) throws ServiceException;

	/**
	 * 修改广告主
	 *
	 * @param advertiser Advertiser
	 * @param loginUser     User
	 * @param remoteIP      远程ip
	 * @throws ServiceException
	 */
	void updateAdvertiserById(Advertiser advertiser, User loginUser, String remoteIP) throws ServiceException;

	/**
	 * 通过ID删除广告主
	 *
	 * @param advertiserId 广告主ID
	 * @param loginUser       User
	 * @param remoteIP        远程ip
	 * @throws ServiceException
	 */
	void deleteAdvertiserById(Long advertiserId, User loginUser, String remoteIP) throws ServiceException;

	/**
	 * 获取广告主列表
	 *
	 * @param advertiserName   广告主名称
	 * @param pageNum             当前页
	 * @param pageSize            每页条数
	 * @return PageInfo<AdvertiserListDTO>
	 */
	PageInfo<AdvertiserListDTO> listAdvertiser(String advertiserName, Integer pageNum, Integer pageSize);

	/**
	 * 获取广告选择列表
	 * @return List<AdvertiserSelectDTO>
	 */
	List<AdvertiserSelectDTO> listAdvertiserSelect();

	/**
	 * 通过账号获取广告主
	 *
	 * @param userName 账号
	 * @return Advertiser
	 * @throws ServiceException
	 */
	Advertiser getAdvertiserByUserName(String userName) throws ServiceException;
}
